import 'dart:convert';
import 'package:flutter_syt/generated/json/base/json_field.dart';
import 'package:flutter_syt/generated/json/order_ailpay_entity.g.dart';

@JsonSerializable()
class OrderAilpayEntity {
  @JSONField(name: "order_no")
  String? orderNo;
  @JSONField(name: "total_fee")
  int? totalFee;
  @JSONField(name: "pay_mode")
  String? payMode;
  @JSONField(name: "pay_data")
  OrderAilpayPayData? payData;

  OrderAilpayEntity();

  factory OrderAilpayEntity.fromJson(Map<String, dynamic> json) =>
      $OrderAilpayEntityFromJson(json);

  Map<String, dynamic> toJson() => $OrderAilpayEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class OrderAilpayPayData {
  @JSONField(name: "access_type")
  String? accessType;
  @JSONField(name: "card_kind")
  String? cardKind;
  @JSONField(name: "mer_id")
  String? merId;
  @JSONField(name: "return_msg")
  String? returnMsg;
  String? attch;
  @JSONField(name: "pay_time")
  String? payTime;
  @JSONField(name: "total_amt")
  String? totalAmt;
  @JSONField(name: "pay_mode")
  String? payMode;
  @JSONField(name: "out_trade_no")
  String? outTradeNo;
  @JSONField(name: "zfb_data_package")
  String? zfbDataPackage;
  @JSONField(name: "msg_id")
  String? msgId;
  @JSONField(name: "return_code")
  String? returnCode;
  @JSONField(name: "order_id")
  String? orderId;

  OrderAilpayPayData();

  factory OrderAilpayPayData.fromJson(Map<String, dynamic> json) =>
      $OrderAilpayPayDataFromJson(json);

  Map<String, dynamic> toJson() => $OrderAilpayPayDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
